package fl.ass.service.api;

import cmm.comm.facade.upload.api.IUploadApiService;
import cmm.comm.facade.upload.condition.SysUlFilesRecQueryCondition;
import cmm.comm.facade.upload.dto.SysUlFilesRecDTO;
import cn.cmm.base.framework.constant.BaseConstant;
import cn.cmm.base.framework.constant.BaseExceptionConstant;
import cn.cmm.base.framework.exception.BaseException;
import cn.cmm.base.framework.utils.BaseLogUtils;
import cn.cmm.base.framework.utils.StringUtils;
import cn.fl.project.constant.PrjPrdDtlConstant;
import fl.ass.facade.api.IAssTrailCarApi;
import fl.ass.facade.api.INevTrailerCarDealFlowFactoryApi;
import fl.ass.facade.condition.AssDealRecAmtQueryCondition;
import fl.ass.facade.constant.AssFileConstant;
import fl.ass.facade.constant.InterfaceConstants;
import fl.ass.facade.dto.AssDealRecAmtDTO;
import fl.ass.facade.dto.AssDealSellDTO;
import fl.ass.facade.dto.AssTrailCarDDTO;
import fl.ass.facade.dto.AssTrailCarMDTO;
import fl.ass.facade.dto.MessageDTO;
import fl.ass.facade.dto.ProductStatusLogDTO;
import fl.ass.service.dao.AssTrailCarDMapper;
import fl.ass.service.service.*;
import fl.flow.facade.flow.constant.FlowConstant;
import fl.flow.facade.flow.dto.FlowCompleteParamsDTO;
import fl.flow.facade.flow.service.impl.FlowBusnessServiceImpl;
import fl.flow.service.flow.service.ISysFlowSHService;
import fl.inf.facade.api.IWarrantApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 新能源拖车管理处置流程回调接口实现类(处置变卖表)
 * @author liwenjun
 *
 */
@Service("nevTrailerCarDealFlowFactoryApi")
public class NevTrailerCarDealFlowFactoryApi extends FlowBusnessServiceImpl implements INevTrailerCarDealFlowFactoryApi {

	private static final Logger log = LoggerFactory.getLogger(NevTrailerCarDealFlowFactoryApi.class);
	/**
	 * 流程启动历史服务
	 */
	@Autowired
	private ISysFlowSHService sysFlowSHService;
	/**
	 * 流处置变卖服务
	 */
	@Autowired
	private IAssDealSellService assDealSellService;
	/**
	 * 处置收款服务
	 */
	@Autowired
	private IAssDealRecAmtService assDealRecAmtService;
	
	/**
	 * 上传下载服务
	 */
	@Autowired
	private IUploadApiService uploadApiService;
	/**
	 * 拖车服务
	 */
	@Autowired
	private IAssTrailCarApi assTrailCarApi;
	/**
	 * 拖车明细服务
	 */
	@Autowired
	private IAssTrailCarDService assTrailCarDService;

	@Autowired
	private IAssCapFundDecomposeService assCapFundDecomposeService;

	/**
	 *权证
	 */
	@Autowired
	private IWarrantApiService warrantApiService;
	@Autowired
	private AssTrailCarDMapper assTrailCarDMapper;
	
	@Autowired
	private IAssTrailCarMcrInsStsService assTrailCarMcrInsStsService;

    @Autowired
    private IAssParkingMgService assParkingMgService;

    @Autowired
    private IAssTrailCarMService assTrailCarMService;
	
	@Override
	public Map<String, Object> executeBefore(FlowCompleteParamsDTO flowCompleteParamsDTO) throws BaseException {
		Map<String, Object> parms = new HashMap<String, Object>();
		String procDefKey = flowCompleteParamsDTO.getProcDefKey();//流程KEY
		String taskDefKey = flowCompleteParamsDTO.getTaskDefKey();//任务KEY
		String branchKey = flowCompleteParamsDTO.getBranchKey();//分支KEY
		String procInstId = flowCompleteParamsDTO.getProcInstId();//流程实例ID
		Long sellId = flowCompleteParamsDTO.getBusinessKey();//业务主键KEY
		BaseLogUtils.newLogger("新能源拖车管理处置流程流程回调接口").setBussinessId("branchKey:" + branchKey).info();
		if("FLOW_00000013_016_001".equals(procDefKey)&&StringUtils.isNotEmpty(taskDefKey)&&StringUtils.isNotEmpty(branchKey)){
			/**
			 *     1.检验变卖价格是否大于等于保底价的0.8(重卡)  结清款是否小于保底价（汽车金融）
			 */
			AssDealSellDTO assDealSellDTO = this.assDealSellService.selectById(sellId);
			AssTrailCarDDTO assTrailCarDDTO;
			Long detailId = assDealSellDTO.getDetailId();
			if(branchKey.equals("FLOW_00000013_016_001_006_001")){//通知打款、维护提车人信息:点击通过
				/**
				 *     1.检验是否填写付款方和收款方（T_DEAL_SELL，条件：变卖ID）
				 */
				BaseLogUtils.newLogger("查询是否填写付款方和收款方信息start").setBussinessId("sellId:" + sellId).info();
				if (StringUtils.isEmpty(assDealSellDTO.getPayeeAccNo())) {
					throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_601, "请填写收款方信息.");
				}
				AssDealRecAmtQueryCondition con = new AssDealRecAmtQueryCondition();
				con.setDataId(sellId);
				con.setDataTypeCd(InterfaceConstants.DATA_TYPE_CD_1);
				con.setIsDel(BaseConstant.IS_YESNO_NO);
				List<AssDealRecAmtDTO> dtos = assDealRecAmtService.searchList(con);
				if (dtos != null && dtos.size() > 0) {
					for (AssDealRecAmtDTO assDealRecAmtDTO : dtos) {
						if (StringUtils.isEmpty(assDealRecAmtDTO.getPayerAccNo())) {
							throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_603, "请填写付款方银行信息.");
						}
					}
				}else{
					throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_601, "请填写付款方银行信息.");
				}
                BaseLogUtils.newLogger("查询是否填写付款方和收款方信息end").setBussinessId("sellId:" + sellId).info();
			}else if(branchKey.equals("FLOW_00000013_016_001_009_001")||branchKey.equals("FLOW_00000013_016_001_011_002")){//通知发起人处置结果,补充提车信息:提交;优车系统管理员确认出库：驳回
				MessageDTO<AssTrailCarMDTO> assTrailCarMDTO = assTrailCarApi.findAssTrailCarMasterById(assDealSellDTO.getMasterId());
				if (assTrailCarMDTO != null && assTrailCarMDTO.getData() != null) {
					Map<String,Object> map = new HashMap<String,Object>();
					map.put("operateKey", branchKey);
                    Long recentParkMgId = this.assParkingMgService.getRecentParkMg(assTrailCarMDTO.getData().getParkId());
                    if (StringUtils.isNotEmpty(recentParkMgId)) {
                        String[] str = {String.valueOf(recentParkMgId)};
                        parms.put("nextAssignee", str);
                    } else {
                        parms.put("nextAssignee", null);
                    }
				}else{
					throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_601, "拖车申请信息不存在.");
				}
			}else if(branchKey.equals("FLOW_00000013_016_001_008_001")){//财务确认到账:点击通过
                BaseLogUtils.newLogger("查询有提车人信息start").setBussinessId("sellId:" + sellId).info();
				if (StringUtils.isEmpty(assDealSellDTO.getPickCarNm())||StringUtils.isEmpty(assDealSellDTO.getPickCarCd())) {
					parms.put("PICK_INFO", BaseConstant.IS_YESNO_NO);
				}else{
					parms.put("PICK_INFO", BaseConstant.IS_YESNO_YES);
					
					MessageDTO<AssTrailCarMDTO> assTrailCarMDTO = assTrailCarApi.findAssTrailCarMasterById(assDealSellDTO.getMasterId());
					if (assTrailCarMDTO != null && assTrailCarMDTO.getData() != null) {
                        Long recentParkMgId = this.assParkingMgService.getRecentParkMg(assTrailCarMDTO.getData().getParkId());
                        if (StringUtils.isNotEmpty(recentParkMgId)) {
                            String[] str = {String.valueOf(recentParkMgId)};
                            parms.put("nextAssignee", str);
                        } else {
                            parms.put("nextAssignee", null);
                        }
					}else{
						throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_601, "拖车申请信息不存在.");
					}

				}
                BaseLogUtils.newLogger("查询有提车人信息end").setBussinessId("sellId:" + sellId).info();
				boolean theNewestFlow = assCapFundDecomposeService.isTheNewestFlow(flowCompleteParamsDTO);
				if (theNewestFlow) {
					//资金分解+计算损益
					assCapFundDecomposeService.capFundDecompose(flowCompleteParamsDTO);
				}
			}else if(branchKey.equals("FLOW_00000013_016_001_011_001")){//优车管理员确认出库:点击通过（修改出库状态）
				/**
				 * TODO 1.检验是否已上传出库单附件
				 * 		2.修改拖车表出库状态及出库时间
				 * 		3.修改出库单资料验证状态
				 */
				
				BaseLogUtils.newLogger("修改出库单的状态Strart").setKeys("detailId:" + assDealSellDTO.getDetailId()).info();
				SysUlFilesRecQueryCondition qc = new SysUlFilesRecQueryCondition();
				qc.setPkId(String.valueOf(assDealSellDTO.getDetailId()));//主数据ID
				qc.setTabNm(AssFileConstant.ASS_TRAIL_CAR_D_TABNM);//主数据表明
				qc.setSysCd(flowCompleteParamsDTO.getSysCd());//系统代码-必须条件
				qc.setCfgCd(AssFileConstant.ASS_TRAIL_CAR_CFGCD);//拖车模块
				qc.setCfgDtlCd(AssFileConstant.ASS_TRAIL_CAR_CFGDTLCD_40);//出库单
				List<SysUlFilesRecDTO> list = this.uploadApiService.searchSysUlFilesRecList(qc);
				if (list == null || list.size() <= 0) {
					throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_601, "更新出库单验证状态失败--请先上传出库单附件.");
				}else{
						qc.setAudStsCd(AssFileConstant.AUD_STS_CD_1);//验证通过
						boolean flag = this.uploadApiService.modifyAudStsCd(qc);
						if (!flag) {
							throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_603, "更新出库单验证状态失败.");
						}
				}
				BaseLogUtils.newLogger("修改出库单的状态end").setKeys("detailId:" + assDealSellDTO.getDetailId()).info();

                BaseLogUtils.newLogger("修改出库状态start").setBussinessId("sellId:" + sellId).info();
				assTrailCarDDTO = this.assTrailCarDService.selectById(detailId);
				assTrailCarDDTO.setIsOut(InterfaceConstants.IS_OUT_1);
				assTrailCarDDTO.setOutTm(new Date());
				MessageDTO<String> result = assTrailCarApi.updateAssTrailCarDetailInfo(assTrailCarDDTO);
				if (!result.isSuccess()) {
						throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_603, "修改出库状态失败.");
				}
                BaseLogUtils.newLogger("修改出库状态end").setBussinessId("sellId:" + sellId).info();
			}else if(branchKey.equals("FLOW_00000013_016_001_012_001")){//财务做账:点击通过 流程结束
				/**
				 * TODO 1、修改拖车处置-变卖表中的流程状态：通过
				 *      2.修改拖车申请表中的处置状态（重卡已变卖）、修改变卖状态
				 *      3.修改支付表状态：重卡已处置、处置结清时间
				 *      4.流程结束
				 * 		
				 */
				BaseLogUtils.newLogger("修改状态start").setKeys("sellId:" + sellId, "detailId:" + detailId).info();
				assDealSellDTO.setFlowStatusCd(InterfaceConstants.FLOW_STATUS_CD_3);
				this.assDealSellService.modify(assDealSellDTO);

				assTrailCarDDTO = this.assTrailCarDService.selectById(detailId);
				assTrailCarDDTO.setDealStsCd(InterfaceConstants.DEAL_STATUS_CD_2);//已处置
				MessageDTO<String> result = assTrailCarApi.updateAssTrailCarDetailInfo(assTrailCarDDTO);
				if (!result.isSuccess()) {
						throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_603, "修改处置状态失败.");
				}
                BaseLogUtils.newLogger("修改状态end").setKeys("sellId:" + sellId, "detailId:" + detailId).info();

                BaseLogUtils.newLogger("修改支付表状态start").info();
				List<ProductStatusLogDTO> proList = new ArrayList<ProductStatusLogDTO>();
				ProductStatusLogDTO proDTO = new ProductStatusLogDTO();
				proDTO.setCurrentStatus(InterfaceConstants.PAY_STATUS_CD_S0106020101);
				proDTO.setPrjPrdId(assTrailCarDDTO.getPrjPrdDtlId());
				proDTO.setOpCode(InterfaceConstants.OP_CODE_OP0025);//拖回处置申请通过
				proDTO.setProcessInstanceCode(procDefKey);
				proDTO.setProcessInstanceId(procInstId);
				proList.add(proDTO);
				result = this.assTrailCarApi.updatePayStatus(proList);
				if (!result.isSuccess()) {
					throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_603, "更新支付表的状态失败.");
				}
                BaseLogUtils.newLogger("修改支付表状态end").info();
//                BaseLogUtils.newLogger("修改小贷保险支付表状态start").info();
//				assTrailCarMcrInsStsService.updateMrcInsSts(assTrailCarDDTO.getCstId());
//                BaseLogUtils.newLogger("修改小贷保险支付表状态end").info();
                BaseLogUtils.newLogger("支付表状态为已拖回，向权证接口传送数据start").setKeys("masterId:" + assTrailCarDDTO.getMasterId(), "detailId:" + assTrailCarDDTO.getId()).info();
				Long projectId = assTrailCarDDTO.getPrjId();
				String paylistCode = assTrailCarDDTO.getPaySchNo();//支付表编号
				String status = InterfaceConstants.PAY_STATUS_CD_S0106020101;//拖回已处置
				Date endDate = null;//结清日期可以为空
				fl.inf.facade.dto.MessageDTO<String> response = warrantApiService.changePayStatus(projectId, paylistCode, status, endDate);
				if (!response.isSuccess()) {
					throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_603, "===向权证接口传送数据失败===.");
				}
                BaseLogUtils.newLogger("支付表状态为已拖回，向权证接口传送数据end").info();
                // 同步修改疫情支付表状态
                ProductStatusLogDTO productStatusLogDTO = new ProductStatusLogDTO();
                productStatusLogDTO.setPaySchId(assTrailCarDDTO.getPaySchId());
                productStatusLogDTO.setPrjPrdId(assTrailCarDDTO.getPrjPrdDtlId());
                productStatusLogDTO.setCurrentStatus(PrjPrdDtlConstant.CODE_PRJ_PRD_STS_CD_14);
                productStatusLogDTO.setOpCode(InterfaceConstants.OP_CODE_OP0025);
                productStatusLogDTO.setProcessInstanceCode(flowCompleteParamsDTO.getProcDefKey());
                productStatusLogDTO.setProcessInstanceId(flowCompleteParamsDTO.getProcInstId());
                this.assTrailCarMService.updateYQPrdStsCdByFlow(productStatusLogDTO);
                /**
                 * 若当前支付表存在未结清YQ项目，则需针对当前支付表关联的资金是否存在剩余可用资金进行校验。
                 */
                boolean check = this.assTrailCarMService.checkRestFund4YQ(assTrailCarDDTO.getPrjPrdDtlId(), assTrailCarDDTO.getCstId());
                if (false == check) {
                    throw new BaseException("存在剩余可用资金，请分解至关联YQ支付表");
                }
			}else if(branchKey.equals("FLOW_00000013_016_001_019_003")||branchKey.equals("FLOW_00000013_016_001_020_003")
					||branchKey.equals("FLOW_00000013_016_001_021_003")||branchKey.equals("FLOW_00000013_016_001_022_003")
					||branchKey.equals("FLOW_00000013_016_001_006_002")||branchKey.equals("FLOW_00000013_016_001_002_002")
					||branchKey.equals("FLOW_00000013_016_001_008_002")){//财务确认到账、通知打款、董事长审批、优车总监1、事业部审核、发起人 、事业部总经理审批（汽车金融）、呈报人确定打款 :不通过 流程结束
				/**
				 * TODO 1、修改拖车处置-变卖表中的流程状态：不通过
				 *      2.修改拖车申请表中的处置状态（处置不通过）
				 *      3.修改支付表状态:已拖回
				 *      4.流程结束
				 *
				 */
				BaseLogUtils.newLogger("修改状态start").setBussinessId("sellId:" + sellId).info();
				assDealSellDTO.setFlowStatusCd(InterfaceConstants.FLOW_STATUS_CD_4);
				this.assDealSellService.modify(assDealSellDTO);

				assTrailCarDDTO = this.assTrailCarDService.selectById(detailId);
				assTrailCarDDTO.setDealStsCd(InterfaceConstants.DEAL_STATUS_CD_3);//处置不通过
				MessageDTO<String> result = assTrailCarApi.updateAssTrailCarDetailInfo(assTrailCarDDTO);
				if (!result.isSuccess()) {
						throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_603, "修改处置状态失败.");
				}
                BaseLogUtils.newLogger("修改状态end").setBussinessId("sellId:" + sellId).info();

				BaseLogUtils.newLogger("修改支付表状态：已拖回start").info();
				List<ProductStatusLogDTO> proList = new ArrayList<ProductStatusLogDTO>();
				ProductStatusLogDTO proDTO = new ProductStatusLogDTO();
				proDTO.setCurrentStatus(InterfaceConstants.PAY_STATUS_CD_S010602);
				proDTO.setPrjPrdId(assTrailCarDDTO.getPrjPrdDtlId());
				proDTO.setOpCode(InterfaceConstants.OP_CODE_OP0021);//拖回处置未通过
				proDTO.setProcessInstanceCode(procDefKey);
				proDTO.setProcessInstanceId(procInstId);
				proList.add(proDTO);
				result = this.assTrailCarApi.updatePayStatus(proList);
				if (!result.isSuccess()) {
					throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_603, "更新支付表的状态失败.");
				}
				BaseLogUtils.newLogger("修改支付表状态：已拖回end").info();

                BaseLogUtils.newLogger("支付表状态为已拖回，向权证接口传送数据start").setKeys("masterId:" + assTrailCarDDTO.getMasterId(), "detailId:" + assTrailCarDDTO.getId()).info();
                Long projectId = assTrailCarDDTO.getPrjId();
                String paylistCode = assTrailCarDDTO.getPaySchNo();//支付表编号
                String status = InterfaceConstants.PAY_STATUS_CD_S010602;
                Date endDate = null;//结清日期可以为空
                fl.inf.facade.dto.MessageDTO<String> response = warrantApiService.changePayStatus(projectId, paylistCode, status, endDate);
                if (!response.isSuccess()) {
                    throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_603, "===向权证接口传送数据失败===.");
                }
                BaseLogUtils.newLogger("支付表状态为已拖回，向权证接口传送数据end").info();
                // 同步修改疫情支付表状态
                ProductStatusLogDTO productStatusLogDTO = new ProductStatusLogDTO();
                productStatusLogDTO.setPaySchId(assTrailCarDDTO.getPaySchId());
                productStatusLogDTO.setPrjPrdId(assTrailCarDDTO.getPrjPrdDtlId());
                productStatusLogDTO.setCurrentStatus(PrjPrdDtlConstant.CODE_PRJ_PRD_STS_CD_01);
                productStatusLogDTO.setOpCode(InterfaceConstants.OP_CODE_OP0001);
                productStatusLogDTO.setProcessInstanceCode(flowCompleteParamsDTO.getProcDefKey());
                productStatusLogDTO.setProcessInstanceId(flowCompleteParamsDTO.getProcInstId());
                this.assTrailCarMService.updateYQPrdStsCdByFlow(productStatusLogDTO);
			}
		}
		return parms;
	}

	@Override
	public void executeAfter(FlowCompleteParamsDTO flowCompleteParamsDTO) throws BaseException {
		String branchKey = flowCompleteParamsDTO.getBranchKey();//分支KEY
		switch (branchKey) {
		case "FLOW_00000013_016_001_012_001"://财务做账:点击通过 流程结束
			this.pass(flowCompleteParamsDTO);
			break;
		case "FLOW_00000013_016_001_019_003":////事业部总监:不通过 
			this.noPass(flowCompleteParamsDTO);
			break;	
		case "FLOW_00000013_016_001_020_003"://风控总监 :不通过 
			this.noPass(flowCompleteParamsDTO);
			break;
		case "FLOW_00000013_016_001_021_003"://事业部总经理 :不通过 
			this.noPass(flowCompleteParamsDTO);
			break;
		case "FLOW_00000013_016_001_022_003"://分管副总裁审批:不通过 
			this.noPass(flowCompleteParamsDTO);
			break;	
		case "FLOW_00000013_016_001_006_002"://通知打款/维护提车人信息 :不通过 
			this.noPass(flowCompleteParamsDTO);
			break;
		case "FLOW_00000013_016_001_002_002"://发起人  :不通过 
			this.noPass(flowCompleteParamsDTO);
			break;
		case "FLOW_00000013_016_001_008_002"://财务确认到账:不通过 
			this.noPass(flowCompleteParamsDTO);
			break;
		default:
			break;
	   }
		
	}

	@Override
	public String getFlowBusinessActMgrOrgCd(FlowCompleteParamsDTO flowCompleteParamsDTO) throws BaseException {
		Long sellId = flowCompleteParamsDTO.getBusinessKey();
		AssDealSellDTO assDealSellDTO = this.assDealSellService.selectById(sellId);
		//拖车明细数据
		List<AssTrailCarDDTO> assTrailCarDDTOList = assTrailCarApi.findTrailCarDetailListById(assDealSellDTO.getMasterId()).getDatas();
		String cstMgrOrgCd = "";
		if (assTrailCarDDTOList != null && assTrailCarDDTOList.size() > 0) {
			Long prjId = assTrailCarDDTOList.get(0).getPrjId();
            BaseLogUtils.newLogger("流程回调实现类获取项目客户经理组织架构代码开始").setKeys("taskId:" + flowCompleteParamsDTO.getTaskId(), "prjId:" + prjId).info();
			if(null!=prjId){
				 cstMgrOrgCd = assTrailCarDMapper.selectCstMgrOrgCd(prjId);
				if (null == cstMgrOrgCd || cstMgrOrgCd.equals("")) {
                    BaseLogUtils.newLogger("根据ID未获取到业务数据!").info();
					throw new BaseException(BaseExceptionConstant.BASE_EXCEPTION_CODE_601, "根据ID未获取到业务数据!");
				}
                BaseLogUtils.newLogger("流程回调实现类获取项目客户经理组织架构代码结束").setKeys("taskId:" + flowCompleteParamsDTO.getTaskId(), "prjId:" + prjId, "cstMgrOrgCd:" + cstMgrOrgCd).info();
				return cstMgrOrgCd;
			}
		}
        BaseLogUtils.newLogger("流程接口回调>>返回项目客户经理组织架构>>未找到!").info();
		return super.getFlowBusinessActMgrOrgCd(flowCompleteParamsDTO);
	}
	/**
	 * 流程结束:通过
	 * @param flowCompleteParamsDTO
	 * @throws BaseException
	 */
	private void pass(FlowCompleteParamsDTO flowCompleteParamsDTO)throws BaseException{
		this.sysFlowSHService.modifyAudStsCd(InterfaceConstants.ASS_FLOW_S_H_ASS, FlowConstant.FLOW_CHECK_STATE_PASS, new Date(), new Date(),
				flowCompleteParamsDTO.getCrtUsrId(), flowCompleteParamsDTO.getBusinessKey(), flowCompleteParamsDTO.getProcDefKey(), 
				flowCompleteParamsDTO.getProcDefId(), flowCompleteParamsDTO.getSysCd(), flowCompleteParamsDTO.getProcInstId());
	}
	/**
	 * 流程结束:不通过
	 * @param flowCompleteParamsDTO
	 * @throws BaseException
	 */
	private void noPass(FlowCompleteParamsDTO flowCompleteParamsDTO)throws BaseException{
		this.sysFlowSHService.modifyAudStsCd(InterfaceConstants.ASS_FLOW_S_H_ASS, FlowConstant.FLOW_CHECK_STATE_NO_PASS, new Date(), new Date(),
				flowCompleteParamsDTO.getCrtUsrId(), flowCompleteParamsDTO.getBusinessKey(), flowCompleteParamsDTO.getProcDefKey(), 
				flowCompleteParamsDTO.getProcDefId(), flowCompleteParamsDTO.getSysCd(), flowCompleteParamsDTO.getProcInstId());
	}
	
}
